package cn.ly.core.model;

import java.sql.Connection;

public class JDBCDriver {
	
	public static void main(String[] args) {
		Connection con = null;
		try {
			Class mysqlDriverClass = Class.forName("com.mysql.jdbc.Driver");
			//Class.forName("oracle.jdbc.driver.OracleDriver");
			String mysqlUrl = "jdbc:mysql://localhost:3306/payDB";
			String oracleUrl = "jdbc:oracle:thin:@localhost:1521:orderDB";
			//这里就是简单工厂模式，当传入mysqlUrl时，获得mysql的driver和相应的connection，如果是oracleUrl则
			//con = DriverManager.getConnection(mysqlUrl, "", "");
			System.out.println(JDBCDriver.class.getClassLoader().getClass().getName());
			System.out.println(mysqlDriverClass.getClassLoader().getClass().getName());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			
		}
	}

}
